package com.atguigu.factory.dAbstractFactory.pizzaStore.order;


import com.atguigu.factory.dAbstractFactory.pizzaStore.pizza.BjCheesePizza;
import com.atguigu.factory.dAbstractFactory.pizzaStore.pizza.BjPepperPizza;
import com.atguigu.factory.dAbstractFactory.pizzaStore.pizza.Pizza;

/**
 * @program: design-patterns
 * @author: yangshen
 * @description: 工厂子类（胡椒披萨工厂类）
 * @create: 2022-01-23 15:52
 **/
public class BjFactory implements AbstractFactory {
    @Override
    public Pizza createPizza(String orderType) {
        System.out.println("~使用的是抽象工厂模式~");
        Pizza pizza = null;
        if (orderType.equals("pepper")){
            pizza = new BjPepperPizza();
        }else if(orderType.equals("cheese")){
            pizza = new BjCheesePizza();
        }
        return pizza;
    }
}
